<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>list</title>
<link rel="stylesheet" href="../../goog/css/common.css">
<link rel="stylesheet" href="../../goog/css/menuseparator.css">
<link rel="stylesheet" href="../../goog/css/flatmenubutton.css">
<link rel="stylesheet" href="../../goog/css/checkbox.css">
<link rel="stylesheet" href="../../goog/css/button.css">
<link rel="stylesheet" href="../../goog/css/custombutton.css">
<link rel="stylesheet" type="text/css" href="../../goog/css/css3button.css">
<script src="../../goog/base.js"></script>
<script>
goog.require('goog.ui.Component');
</script>
<script src="component.js"></script>
<script src="listitemrenderer.js"></script>
<script src="listitem.js"></script>
<script src="listrenderer.js"></script>
<script src="list.js"></script>
<script>
goog.require('goog.dom');
goog.require('goog.ui.Button');
goog.require('goog.ui.ButtonRenderer');
goog.require('goog.ui.ButtonSide');
goog.require('goog.ui.CustomButton');
goog.require('goog.ui.Css3ButtonRenderer');
</script>
<style>
body {
	font: 10pt/1.2em Arial, sans-serif; 
}
#buttons {
	margin-top: 50px;
}
.fiesc-li {
	padding: 10px 5px;
}

.fiesc-li-odd {
	background-color: #f5f5f5;
}

</style>
</head>
<body>
<div id="list"></div>
<div id="buttons"></div>
<script>
console.log(goog.events.getTotalListenerCount());

var list = new fiesc.ui.List();
list.addItem(new fiesc.ui.ListItem('Tiago'));
list.addItem(new fiesc.ui.ListItem('Frederico'));
list.addItem(new fiesc.ui.ListItem('Silva'));
list.addItem(new fiesc.ui.ListItem('Bassan'));
list.render(goog.dom.getElement('list'));
//list.setSelectable(true);

console.log(goog.events.getTotalListenerCount());

var bt1 = new goog.ui.CustomButton('Remove children',
		goog.ui.Css3ButtonRenderer.getInstance());
bt1.render(goog.dom.getElement('buttons'));
goog.events.listen(bt1, goog.ui.Component.EventType.ACTION, 
		function(e){
			this.removeItems(true);
			console.log(goog.events.getTotalListenerCount());
		}, false, list);

var bt3 = new goog.ui.CustomButton('Remove last child',
		goog.ui.Css3ButtonRenderer.getInstance());
bt3.render(goog.dom.getElement('buttons'));
goog.events.listen(bt3, goog.ui.Component.EventType.ACTION, 
		function(e){
			this.removeItem(this.getItems()[this.getItemsCount()-1], true);
			console.log(goog.events.getTotalListenerCount());
		}, false, list);

var bt4 = new goog.ui.CustomButton('Set selectable',
		goog.ui.Css3ButtonRenderer.getInstance());
bt4.render(goog.dom.getElement('buttons'));
goog.events.listen(bt4, goog.ui.Component.EventType.ACTION, 
		function(e){
			this.setSelectable(!this.isSelectable());
			console.log(goog.events.getTotalListenerCount());
		}, false, list);

var bt5 = new goog.ui.CustomButton('Selected all',
		goog.ui.Css3ButtonRenderer.getInstance());
bt5.render(goog.dom.getElement('buttons'));
goog.events.listen(bt5, goog.ui.Component.EventType.ACTION, 
		function(e){
			this.setAllSelected(!this.isAllSelected());
			console.log(goog.events.getTotalListenerCount());
		}, false, list);

var bt6 = new goog.ui.CustomButton('Get selected items',
		goog.ui.Css3ButtonRenderer.getInstance());
bt6.render(goog.dom.getElement('buttons'));
goog.events.listen(bt6, goog.ui.Component.EventType.ACTION, 
		function(e){
			console.log(this.getSelectedItems());
			console.log(goog.events.getTotalListenerCount());
		}, false, list);

var bt7 = new goog.ui.CustomButton('Add item',
		goog.ui.Css3ButtonRenderer.getInstance());
bt7.render(goog.dom.getElement('buttons'));
goog.events.listen(bt7, goog.ui.Component.EventType.ACTION, 
		function(e){
			this.addItem(new fiesc.ui.ListItem('Tiago'));
			console.log(goog.events.getTotalListenerCount());
		}, false, list);

var bt2 = new goog.ui.CustomButton('Dispose',
		goog.ui.Css3ButtonRenderer.getInstance());
bt2.render(goog.dom.getElement('buttons'));
goog.events.listen(bt2, goog.ui.Component.EventType.ACTION, 
		function(e){
			this.dispose();
			console.log(goog.events.getTotalListenerCount());
		}, false, list);
</script>
</body>
</html>